<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <!--    <script src="/js/jquery-3.4.1.min.js"></script>-->
</head>
<body>
<div id="content-div">
</div>
<div id="deleteResult"></div>
<input onclick="getData()" type="button" value="提交数据"> <br/>
<input onclick="deleteData()" type="button" value="删除数据"> <br/>
<script type="text/javascript">
    function deleteData() {
        $.ajax({
            url: 'http://localhost:8080/book/99',
            type: 'delete',
            success: function (msg) {
                $("#deleteResult").html(msg);
            }
        })
    }

    function getData() {
        $.ajax({
            url: 'http://localhost:8080/book/',
            type: 'post',
            data: {name: "sanguo"},
            success: function (msg) {
                $("#content-div").html(msg);
            }
        })
    }
</script>
</body>
</html>